package travel.myTravel;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import travel.Travel_Information_DAO;
import travel.Travel_Information_VO;

public class MyTravel_DAO implements MyTravel_IDAO {

	Travel_Information_DAO tid = new Travel_Information_DAO();
	@Override//나의 여행
	public List<Travel_Information_VO> selectMyTravel() {
		Connection conn = null;
		PreparedStatement pstmt = null;
		ResultSet rs = null;
		
		ArrayList test  = new ArrayList();
		try{
			conn = tid.openDatabase();
			pstmt = conn.prepareStatement(tid.arrayAddTest);
			rs = pstmt.executeQuery();
			while(rs.next()){
				Travel_Information_VO tl = new Travel_Information_VO();
				tl.setTravel_code(rs.getString("travel_code"));
				tl.setTravel_place(rs.getString("travel_place"));
				tl.setTravel_price(rs.getString("travel_price"));
				tl.setTravel_notice(rs.getString("travel_notice"));
				test.add(tl);
			}
		}catch(SQLException ex){
			ex.printStackTrace();
		}finally{tid.close(conn, pstmt, rs);}
		return test;
	}
	
	
}